package com.example.controller;

import com.example.api.Result;
import com.example.dto.StudentDegreeDataDto;
import com.example.service.ReportService;
import com.example.vo.report.JobOption;
import com.example.vo.report.StudentCount;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;


    /**
     * 统计各个职位的员工人数
     */
    @GetMapping("/empJobData")
    public Result<JobOption> getEmpJobData(){

        JobOption jobOption = reportService.getEmpJobData();
        return Result.success(jobOption);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map> genderList = reportService.getEmpGenderData();
        return Result.success(genderList);
    }

    @GetMapping("/studentCountData")
    public Result<StudentCount> getStudentCountData(){

        return Result.success(reportService.getStudentCount());
    }

    @GetMapping("/studentDegreeData")
    public Result<List<StudentDegreeDataDto>> getStudentDegreeData(){

        return Result.success(reportService.getStudentDegreeData());
    }
}
